﻿using System.Collections;
using UnityEngine;

public class CubeScript : MonoBehaviour
{
    // Use this for initialization
    void Start()
    {

    }

    // Update is called once per frame
    void Update()
    {

    }
    public void OnSelect()
    {
        //随机变换物体颜色
        gameObject.GetComponent<MeshRenderer>().material.color = new Color(Random.Range(0, 255) / 255f, Random.Range(0, 255) / 255f, Random.Range(0, 255) / 255f);
    }
}